home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Mp3 / SoundAppPPC.sit / SoundApp PPC.rsrc / TEXT_1003_AppleScript.txt < prev    next >
Text File  |  1998-04-17  |  10KB  |  93 lines

  1. AppleScript
  2.  
  3. This section gives an overview of SoundApp‚Äôs support for the AppleEvent Object Model and AppleScript. Not everything is documented here. For more information, see your documentation on AppleScript and the Scripting Dictionary of SoundApp using your favorite script editor.
  4.  
  5. Script Menu
  6. SoundApp supports a script menu which allows scripts to be executed directly from a menu in SoundApp. In order to utilize this feature, create a folder called ‚ÄúScript Menu Items‚Äù in the same directory as the SoundApp application. Then place compiled scripts into the folder and launch SoundApp. A new ‚ÄúScript‚Äù menu will be added to the menu bar, listing the scripts in the folder. Simply select one to run it. Scripts can direct SoundApp or other applications to do just about anything.
  7.  
  8. Application
  9. In addition to the Core Suite of open, run, and quit (print is not supported), SoundApp supports the following verbs:
  10.  
  11. ‚óä convert {alias, alias list, string, string list} [to {alias, alias list, string, string list}] [encoding {PCM, ¬µLaw, IMA}] [channels {default, mono, stereo}] [bits {default, eight, sixteen}] [rate rate] [law {full, reduced, smart}] [with(out) DOSify] [with(out) suffix] [as {System7, suitcase, AIFF, Wave, AU, NeXT, SD, QuickTime}] [start at time] [stop at time]: Converts the specified file(s) to the destination file(s). If multiple source files are specified and a single destination, the destination is assumed to be a folder. If no to parameter is specified, the default conversion output method is used (as specified in the Convert pane of the Preferences dialog). The encoding, channels and bits parameters allow the encoding, channel and bit resolution setting to be overridden. The rate parameter allows the output sampling rate setting to be changed. If these are omitted, the value specified in the Convert pane of the Preferences dialog will be used. The law parameter controls whether ¬µ-law and a-law files are converted as 16-bit (full), 8-bit (reduced) or 8-bit with smart processing (smart). The DOSify parameter causes new output file names to be created with the archaic MS-DOS 8.3 file name format. The suffix parameter causes the new output file to be created with a three letter dot-suffix, e.g. ‚Äú.wav‚Äù. These last two are ignored if a single file is converted and the to parameter is specified. The as parameter allows the output sound format to be specified. Again, if it‚Äôs not specified, the default in the Convert pane of the Preferences dialog will be used instead. The start at and stop at parameters allow conversion of a specified range of the original sound file as specified in seconds. A single one may be specified, if desired.
  12.  
  13. ‚óä play {alias, alias list, string, string list} [bits {default, eight, sixteen}] [law {full, reduced, smart}] [buffer size] [MODDriver {trecker, preferTrecker, preferZSS, ZSS}] [MODStereo {mono, stereo, enhanced}] [with(out) MODFilter] [with(out) MODSixteen] [with(out) MODTempMem] [MODVolume volume] [modRate rate] [MIDIDriver {QuickTime, OMS}] [with(out) sendGMReset] [with(out) ignoreSysEx] [with(out) useMIDIVolume] [start at time] [stop at time]: Plays the file or files passed as the direct parameter. The bits and law parameters function as above. The buffer parameter specifies the size in kilobytes of the buffer used for double-buffering. A value of zero means don‚Äôt double-buffer; otherwise, the value must be at least 64. The MODDriver, MODtereo, MODixteen, MODilter, MODTempMem, MODRate and modVolume parameters control the ‚ÄúMOD Driver,‚Äù ‚ÄúStereo Mode,‚Äù ‚ÄúReal-Time Filter,‚Äù ‚Äú16-Bit,‚Äù ‚ÄúUse System Memory,‚Äù ‚ÄúPlayback Rate‚Äù and ‚ÄúVolume‚Äù settings in the MOD pane of the Preferences dialog respectively. The MIDIDriver, sendGMReset, ignoreSysEx and useMIDIVolume parameters control the ‚ÄúMIDI Driver,‚Äù ‚ÄúSend General MIDI Reset,‚Äù ‚ÄúIgnore SysEx Messages,‚Äù and ‚ÄúUse Playback Volume‚Äù settings in the MIDI pane of the Preferences dialog respectively. The volume value must be at least zero and no more than 255. The rate value must be at least 8000 and no more than 48000. The start at and stop at parameters allow playback of a specified range of the original sound file as specified in seconds.
  14.  
  15. ‚óä send oms data string: Sends raw MIDI data to an OMS synthesizer. The data is consists of a string of hexadecimal octets. MIDI timing is not supported. Also, remember to include the length fields for system exclusive messages. For example, to send a ‚ÄúGM Reset‚Äù command, use the command: send oms data "f0 05 7e 7f 09 01 f7". Note the ‚Äú05‚Äù which is the length of the system exclusive message.
  16.  
  17. ‚óä display information {alias, alias list, string, string list}: Opens an information window for each of the specified files.
  18.  
  19. ‚óä fetch information {alias, alias list, string, string list}: Returns a record or list of records containing information about the specified sound file or files.
  20.  
  21. ‚óä get status: Returns one of {idle, busy, paused} indicating what SoundApp is currently doing.
  22.  
  23. ‚óä set status to {paused, next, previous, stopped}: Changes the current activity status of SoundApp. ‚ÄúPaused‚Äù pauses or resumes playback, ‚Äúnext‚Äù and ‚Äúprevious‚Äù jump to the next or previous file and ‚Äústopped‚Äù stops processing immediately.
  24.  
  25. ‚óä get preferences: Returns a record containing a list of all the global preferences.
  26.  
  27. ‚óä set preferences to {preference: value ‚Ķ}: Changes one or all of the global preferences based on a specified record. Single preferences can be operated on directly if desired, e.g. set autoQuit to true.
  28.  
  29. ‚óä get conversion setting specifier: Retrieves the indexed or named conversion setting. The object conversion settings can be used to retrieve a list of all of them.
  30.  
  31. ‚óä get setting of conversion setting: Retrieves an attribute from the specified conversion setting.
  32.  
  33. ‚óä set setting of conversion setting to specifier: Sets an attribute of the specified conversion setting to the specified value.
  34.  
  35. ‚óä set convert settings save flag to {true, false}: Sets an internal flag which controls whether to save the conversion settings whenever they are changed via an AppleEvent. This can speed processing, but the settings will be lost when SoundApp exits. This flag has no effect on changing the conversion settings via the user interface. It only affects scripting.
  36.  
  37. ‚óä get convert settings save flag: Returns the value of the internal flag which can be set with the above command.
  38.  
  39. ‚óä get playback volume: Returns the current playback volume SoundApp uses relative to the system volume. The number is in the range 1 to 384. A value of 256 is 100%.
  40.  
  41. ‚óä set playback volume to value: Sets the current playback volume SoundApp uses relative to the system volume. The value is the same as above.
  42.  
  43. ‚óä get current file: Returns a record containing the name, type, file specification and entry object in the Play List (if applicable) for the file currently being processed. The string "none" is returned if no file is currently being processed.
  44.  
  45. ‚óä get play position: Returns the current position in seconds in the file currently being played. If no file is being played zero is returned.
  46.  
  47. ‚óä set play position: Jumps to the specified position in seconds in the file currently being played, if possible. 
  48.  
  49. ‚óä show {about, help, QnA} window: Opens the About window and displays either the About, Help or Q & A pane, respectively. You can use ‚Äúset/get pane‚Äù to manipulate the current pane in the window.
  50.  
  51. ‚óä yield: Yields time to SoundApp to process files. This can be used in an AppleScript loop which waits for status to go to idle to determine when SoundApp is done.
  52.  
  53. Play Lists
  54. Play lists are references as a document in SoundApp. The following verbs can be used on them:
  55.  
  56. ‚óä insert into document files file at position: Inserts the specified file at the specified position (an integer) in the Play List window document.
  57.  
  58. ‚óä play from entries {selected, list of entries}: Plays either the currently selected entries or the list of entries specified.
  59.  
  60. ‚óä convert from entries {selected, list of entries}: Converts either the currently selected entries or the list of entries specified.
  61.  
  62. ‚óä get information from entries {selected, list of entries}: Gets information for either the currently selected entries or the list of entries specified.
  63.  
  64. ‚óä delete entry: Removes the specified entry from the list.
  65.  
  66. ‚óä move entry to location: Moves the specified entry to another location  in the list.
  67.  
  68. ‚óä duplicate entry to location: Creates a copy of the specified entry at another location in the list.
  69.  
  70. ‚óä set {shuffle, repeatProcessing} to {true, false}: Changes the value of the Shuffle and Repeat checkboxes.
  71.  
  72. ‚óä get {shuffle, repeatProcessing}: Retrieves the value of the Shuffle and Repeat checkboxes.
  73.  
  74. ‚óä get sort mode: Retrieves the sorting mode. Valid values are none, by name and by type.
  75.  
  76. ‚óä set sort mode to {none, by name, by type}: Retrieves or changes the sorting mode.
  77.  
  78. ‚óä get selection: Retrieves the current selection.
  79.  
  80. ‚óä set selection to {entry, list of entries}: Changes the selection to the specified entry or entries.
  81.  
  82. Objects
  83. The following objects are supported:
  84.  
  85. ‚óä application: The SoundApp application.
  86.  
  87. ‚óä document: A Play List document. Documents can only be referenced by name.
  88.  
  89. ‚óä entry: An entry in a Play List.
  90.  
  91. ‚óä conversion setting: A list containing all the output setting parameters.
  92.  
  93. ‚óä preferences record: A record consisting of all the SoundApp global preferences. Settings in the Convert menu are not included here.